import numpy as np
import pandas as pd
# import plotly.express as px
# https://plotly.com/python/
import plotly.graph_objects as go
import ipywidgets as widgets
from ipywidgets import interact, interactive, fixed, interact_manual
from plotly.subplots import make_subplots
# import datetime
from urllib.request import urlopen
import json
from pandas.io.json import json_normalize
kota_jabar = pd.read_csv("jabar.csv")
# https://plotly.com/python/mapbox-layers/#openstreetmap-tiles-no-token-needed
import plotly.express as px
fig = px.scatter_mapbox(kota_jabar, lat="latitude", lon="longitude", hover_name="nama_kec", hover_data=["gender", "status"],
color = "status", color_discrete_sequence=["orange","purple","red"], zoom=7.5, height=500)
fig.update_layout(mapbox_style="carto-positron")
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()
from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>''')
# <form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')